#define _CRT_SECURE_NO_WARNINGS
#include"vector.h"

void Print(gy::vector<int>& v)
{
	for (size_t i = 0; i < v.size(); i++)
	{
		cout << v[i] << " ";
	}
	cout << endl;
}

//int main()
//{
//	gy::vector<int> v;
//	v.push_back(1);
//	v.push_back(2);
//	v.push_back(3);
//	v.push_back(4);
//	v.push_back(5);
//	v.push_back(6);
//	for (size_t i = 0; i < v.size(); i++)
//	{
//		cout << v[i] << " ";
//	}
//	cout << endl;
//	for (auto& e : v)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//	return 0;
//}

void vector_test1()
{
	gy::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	/*v.push_back(5);
	v.push_back(6);*/
	Print(v);

	v.pop_back();
	Print(v);

	v.insert(v.begin(), -1);
	Print(v);

	v.insert(v.begin() + 3, 9);
	Print(v);
}
void vector_test2()
{
	gy::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	Print(v);

	v.erase(v.begin());
	Print(v);

}

void vector_test3()
{
	gy::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	Print(v1);

	gy::vector<int> v2 = v1;
	Print(v2);
	gy::vector<int> v3 = { 1, 2, 3, 4, 9, 20, 22};
	Print(v3);

	gy::vector<int> v4(v3.begin() + 1, v3.end() - 2);
	Print(v4);

	gy::vector<int> v5(10, 7);
	Print(v5);

	
}

int main()
{
	vector_test3();
	return 0;
}